home *** CD-ROM | disk | FTP | other *** search
/ Amiga Plus Special 18 / AMIGAplus Sonderheft 18 (1999)(ICP)(DE)[!].iso / PD / Spiele / lazymines / install < prev    next >
Text File  |  1999-01-03  |  6KB  |  172 lines

  1. ; $VER: install 3.2 (15.12.98)
  2. ; Script to install LazyMines 3.2
  3.  
  4. ;=============================================================================
  5. ;English strings
  6.  
  7. (set #bad-kick
  8.      "You need at least version 37 of AmigaOS to run LazyMines.")
  9.  
  10. (set #how-install
  11.      (cat "Do you want to install the whole program or just update the "
  12.           "language catalogs?"))
  13.  
  14. (set #how-install-help
  15.      (cat "Choose \"Install whole program\" if you are installing from "
  16.           "scratch or if you are updating an old version.\n"
  17.           "\nChoose \"Update languages\" if you want to install or remove "
  18.           "language catalogs."))
  19.  
  20. (set #how-install-1 "Install whole program")
  21. (set #how-install-2 "Update languages")
  22.  
  23. (set #where-install
  24.      "Choose location where you want to install LazyMines.")
  25.  
  26. (set #which-documentation
  27.      "Which documentation do you want to install with LazyMines?")
  28.  
  29. (set #which-documentation-help
  30.      "Check the language you want to install with LazyMines.")
  31.  
  32. (set #which-icons
  33.      "Which icons do you want to install with LazyMines?")
  34.  
  35. (set #which-icons-help
  36.      (cat "Choose \"MagicWB icons\" if you have MagicWB installed, "
  37.           "otherwise choose \"Standard icons\"."))
  38.  
  39. (set #which-icons-2 "MagicWB icons")
  40. (set #which-icons-1 "Standard icons")
  41.  
  42. (set #no-languages
  43.      (cat "You need at least version 38 of AmigaOS to have any use for the "
  44.           "language catalogs."))
  45.  
  46. (set #where-languages
  47.      "Where do you want to install the language catalogs?")
  48.  
  49. (set #where-languages-help
  50.      (cat "This lets you choose if you want the language catalogs to be "
  51.           "copied to the same location as the rest of the program, or if "
  52.           "you want to have them in the global Catalog dir."))
  53.  
  54. (set #which-languages
  55.      "Which language catalogs do you want to install with LazyMines?")
  56.  
  57. (set #which-languages-help
  58.      (cat "Check all languages you want to install with LazyMines.\n"
  59.           "\nIf a language already installed is not checked, "
  60.           "it will be removed."))
  61.  
  62.  
  63. ;=============================================================================
  64. ;Procedures
  65.  
  66. (procedure install-program
  67.   (set @default-dest prog-dest)
  68.   (copylib (source (tackon sourcedir "LazyMines"))
  69.            (dest prog-dest))
  70.   (copylib (source (tackon sourcedir "LazyMines.guide"))
  71.            (dest prog-dest)))
  72.  
  73. (procedure install-icons
  74.   (set which-icons (askchoice (prompt #which-icons)
  75.                               (help #which-icons-help)
  76.                               (choices #which-icons-1 #which-icons-2)))
  77.   (if (= which-icons 1)
  78.       (set icon-srcdir (tackon icon-srcdir "misc")))
  79.   (copyfiles (source icon-srcdir)
  80.              (dest prog-dest)
  81.              (choices "LazyMines.info" "LazyMines.guide.info"))
  82.   (tooltype (dest (tackon prog-dest "LazyMines"))
  83.             (noposition))
  84.   (tooltype (dest (tackon prog-dest "LazyMines.guide"))
  85.             (noposition)))
  86.  
  87. (procedure install-locales
  88.   (set where-languages (askchoice (prompt #where-languages)
  89.                                   (help #where-languages-help)
  90.                                   (choices locale-dest
  91.                                            locale-sysdest)))
  92.   (if (= where-languages 1)
  93.       (set locale-dest locale-sysdest))
  94.   (set which-languages (askoptions (prompt #which-languages)
  95.                                    (help #which-languages-help)
  96.                                    (choices "Dansk"
  97.                                             "Deutsch"
  98.                                             "Italiano"
  99.                                             "Norsk"
  100.                                             "Polski"
  101.                                             "Svenska")))
  102.   (set locale "dansk")
  103.   (if (IN which-languages 0)
  104.       (install-locale)
  105.       (remove-locale))
  106.   (set locale "deutsch")
  107.   (if (IN which-languages 1)
  108.       (install-locale)
  109.       (remove-locale))
  110.   (set locale "italiano")
  111.   (if (IN which-languages 2)
  112.       (install-locale)
  113.       (remove-locale))
  114.   (set locale "norsk")
  115.   (if (IN which-languages 3)
  116.       (install-locale)
  117.       (remove-locale))
  118.   (set locale "polski")
  119.   (if (IN which-languages 4)
  120.       (install-locale)
  121.       (remove-locale))
  122.   (set locale "svenska")
  123.   (if (IN which-languages 5)
  124.       (install-locale)
  125.       (remove-locale)))
  126.  
  127. (procedure install-locale
  128.   (makedir locale-dest)
  129.   (makedir (tackon locale-dest locale))
  130.   (copylib (source (tackon (tackon locale-srcdir locale) "lazymines.catalog"))
  131.            (dest (tackon locale-dest locale))))
  132.  
  133. (procedure remove-locale
  134.   (delete (tackon (tackon locale-dest locale) "lazymines.catalog"))
  135.   (if (NOT (= locale-dest locale-sysdest))
  136.       ((delete (tackon locale-dest locale))
  137.        (delete locale-dest))))
  138.  
  139.  
  140. ;=============================================================================
  141. ; Main program
  142.  
  143. (if (< (/ (getversion) 65536) 37)
  144.     (abort #bad-kick))
  145.  
  146. (welcome)
  147.  
  148. (set sourcedir (pathonly @icon))
  149. (set icon-srcdir sourcedir)
  150. (set locale-srcdir (tackon sourcedir "Catalogs"))
  151. (set locale-sysdest "LOCALE:Catalogs")
  152.  
  153. (set prog-dest (askdir (prompt #where-install)
  154.                        (help @askdir-help)
  155.                        (default @default-dest)))
  156.  
  157. (set how-install (askchoice (prompt #how-install)
  158.                             (help #how-install-help)
  159.                             (choices #how-install-1 #how-install-2)))
  160.  
  161. (if (= how-install 0)
  162.     ((install-program)
  163.      (install-icons)
  164.      (run (cat "convscorefile \"" prog-dest "\"")))
  165.     (set @default-dest ""))
  166.  
  167. (if (= (exists "LOCALE:") 0)
  168.     (exit #no-languages))
  169.  
  170. (set locale-dest (tackon prog-dest "Catalogs"))
  171. (install-locales)
  172.